{% extends 'base.html' %}
{% block title %}  - All projects {% endblock %}
{% block content %}

<div id="content" style="position:absolute; top:20px; left:0px; background-color: #1A1A1A; layer-background-color: #1A1A1A; border: 1px none #000000;"> 

<table width="610">
	<tr>
	<td colspan="3"><p><span style="font-size:14px;color:#CCC">All projects</span></p></td>
	</tr>
	<tr><td colspan="3">
<p>Project list | {% if projects.has_previous %} <a href="?page={{ projects.previous_page_number }}" title="Previous page"><<<</a> {% endif %}
		Page {{ projects.number }} of {{ projects.paginator.num_pages }}.
		{% if projects.has_next %}
		<a href="?page={{ projects.next_page_number }}" title="Next page">>>></a>
		{% endif %}
	</p>
    </tr></td>
    
	{% for project in projects.object_list %}
<tr>
		<td width="120"><a href="/project/{{project.id}}/" title="Open project">{{project.name}}</a></td>
        <td>{{project.description|safe|slice:"100" }}</td>
        <td width="40">
        {% if user.username == 'kth' or user.id == project.creator.id %}
				<a href="/project/{{project.id}}/edit/" title="Edit project">
				<img src="/site_media/img/approve.gif"/>
			</a>
        <a href="/project/{{project.id}}/delete/" title="Delete project" onmousedown="return confirm('Delete this project?')">
				<img src="/site_media/img/trash.gif"/>
			</a>
		{% endif %}
        </td>
	</tr>
	{% endfor %}
</table>
</div>

{% endblock %}